package com.panshi.api;

import com.panshi.vo.qa.DataResultQA;
import com.panshi.vo.qa.Messag;
import com.panshi.vo.qa.Pages;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@FeignClient(value = "qa-server",contextId="messag-api")
public interface IMessagApi {
    /*IMessagApi(站内消息Api)*/

    //站内消息添加
    @PostMapping("/messag/addMessag")
    DataResultQA addMessag(@RequestBody Messag messag);

    //分页查询站内消息
    @PostMapping("/messag/inquirePagesMessag")
    DataResultQA<List<Messag>> inquirePagesMessag(@RequestBody Pages pages);

    //查询总数
    @PostMapping("/messag/inquireSum/{userId}")
    DataResultQA<Integer> inquireSum(@PathVariable int userId);

    //修改站内消息
    @PostMapping("/messag/updateMessag")
    DataResultQA updateMessag(@RequestBody Messag messag);

    //已读
    @PostMapping("/messag/messagMsgRead/{id}")
    DataResultQA messagMsgRead(@PathVariable Integer id);
}
